/*******************************************************************************
 * Copyright (c) 2002, 2010 QNX Software Systems and others.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *******************************************************************************/
package org.eclipse.cdt.utils.pty;

import java.io.InputStream;
import java.io.OutputStream;

/**
 * PTY - pseudo terminal support.
 */
public class SoftTerminal implements Terminal {

  final boolean console;
  String slave;
  InputStream in;
  OutputStream out;
  public int master;

  public class MasterFD {
    public int getFD() {
      return master;
    }

    void setFD(int fd) {
      master = fd;
    }
  }

  public SoftTerminal(boolean console) {
    this.console = console;

    slave = "slave";
  }

  public String getSlaveName() {
    return slave;
  }

  public MasterFD getMasterFD() {
    return new MasterFD();
  }

  public final boolean isConsole() {
    return console;
  }

  public OutputStream getOutputStream() {
    return null;
  }

  public InputStream getInputStream() {
    return null;
  }

  public final void setTerminalSize(int width, int height) {
    
  }

  public static boolean isSupported() {
    return true;
  }
}
